<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function time() {
      let newDate = new Date()
      let dateHousr = newDate.getHours()
      dateHousr = dateHousr < 10 ? '0' + dateHousr : dateHousr
      let dateMinte = newDate.getMinutes()
      dateMinte = dateMinte < 10 ? '0' + dateMinte : dateMinte
      let dateSecon = newDate.getSeconds()
      dateSecon = dateSecon < 10 ? '0' + dateSecon : dateSecon
      let week = ['星期天', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六']
      let dateWeek = newDate.getDay()
      document.body.innerText = week[dateWeek] + '[' + dateHousr + ' : ' + dateMinte + ' : ' + dateSecon + ']'
    }
    setInterval(time, 1000)

  </script>
</body>

</html>